<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org"
  xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">

<head th:replace="_header_include::frag(~{::title},~{::style},~{})">
  <title>后台管理系统</title>
  <style>
    button a {
      color: #fff !important;
    }

    beforeRemove .formItem,
    .formItem .el-form-item__content {
      width: 100%
    }

    .orgSelectOopover {
      width: 100%;
      text-align: left;
      position: relative;
      border: 1px solid #dcdde2;
      background: #fff;
    }

    .orgSelectOopover:hover {
      background-color: #fff;
      border-color: #c0c4cc;
    }

    .orgSelectInput {
      position: absolute;
      left: 0;
      top: 0;
      width: 90%;
    }

    .orgSelectInput input {
      border: none;
      background: none;
    }

    .orgSelectInput input:hover {
      cursor: pointer;
    }

    .el-tree-node__expand-icon.is-leaf~.el-tree-node__label {
      color: #1979fd
    }

    .headPortrait .el-upload-list__item:first-child {
      margin-top: 0 !important;
    }

    .selectTime .el-date-editor.el-input,
    .el-date-editor.el-input__inner {
      width: 138px !important;
    }

    .el-form-item__label {
      width: auto !important;
      margin-right: 20px;
    }

    .mainSearchFormBox-form {
      display: flex;
      justify-content: space-between;
      padding-right: 10px;
    }

    .mainSearchBtnBox-right {
      display: flex;
      justify-content: space-between;
      padding-right: 10px;
    }

    .mainSearchBtnBox-right .el-form-item__label {
      margin-right: 10px;
    }

    .scope-text {
      word-break: break-all;
      text-overflow: ellipsis;
      overflow: hidden;
      display: -webkit-box;
      -webkit-line-clamp: 2;
      -webkit-box-orient: vertical;
    }

    .auditStatus-class {
      display: flex;
      justify-content: center;
    }

    .auditStatus-class .el-button {
      font-size: 12px;
      padding: 9px 15px;
    }

    .merchantCertDto {
      padding-bottom: 4px;
      display: flex;
    }

    .merchantCertDto-name {
      width: 100px;
      text-align: right;
      display: inline-block;
    }

    .merchantCertDto-look {
      margin-left: 5px;
      color: rgb(0, 114, 255);
      cursor: pointer;
    }

    .el-textarea__inner {
      height: 100px;
    }

    .refuse-dialog {
      display: flex;
    }

    .refuse-dialog-title {
      width: 80px;
      margin-top: 5px;
    }

    .merchantCertDto-download {
      color: rgb(0, 114, 255);
      margin-top: 5px;
      cursor: pointer;
    }

    .look-reason {
      color: rgb(0, 114, 255);
      cursor: pointer;
    }

    .merchantCertDto-img-ulr {
      max-width: 800px;
    }

    .certificates .tips {
      color: #b2b3b7;
      font-size: 12px;
    }

    .certificates .tips span {
      font-weight: 500;
      color: #666;
    }

    .certif-form .el-form-item__label {
      width: 110px !important;
      font-size: 14px;
    }

    .certif-form .el-upload-list__item {
      margin-left: 40px;
      width: 80%;
    }
  </style>
</head>

<body>
  <div id="userManage" class="userManage mainPadding" style="display: none;">
    <el-breadcrumb separator="/" class="elBreadcrumb marginB20">
      <el-breadcrumb-item>Home</el-breadcrumb-item>
      <el-breadcrumb-item>系统管理</el-breadcrumb-item>
      <el-breadcrumb-item>商家账号管理</el-breadcrumb-item>
    </el-breadcrumb>
    <el-row class="marginB20">
      <shiro:hasPermission name="sys:merchantUser:add">
        <el-button type="primary" @click="toAddUser"><i class="el-icon-plus"></i>添加账号</el-button>
      </shiro:hasPermission>
      <shiro:hasPermission name="sys:merchantUser:edit">
        <el-button type="success" @click="toUpdateUser"><i class="el-icon-edit"></i>编辑账号</el-button>
      </shiro:hasPermission>
    </el-row>
    <div class="mainSearchBg">
      <div class="mainSearchFormBox">
        <el-form :inline="true" :model="userSearchForm" class="demo-form-inline mainSearchForm" ref="userSearchForm">
          <div class="mainSearchFormBox-form">
            <el-form-item label="登录名:">
              <el-input v-model="userSearchForm.userName" class="input-with-select"></el-input>
            </el-form-item>
            <el-form-item label="商家名称:">
              <el-input v-model="userSearchForm.name" class="input-with-select"></el-input>
            </el-form-item>
            <el-form-item label="账号状态:" prop="status" label-width="75px">
              <el-select clearable v-model="userSearchForm.status" placeholder="全部状态" @visible-change="seleckClick">
                <el-option v-for="item in statusOptions" :key="item.value" :label="item.label" :value="item.value">
                </el-option>
              </el-select>
            </el-form-item>
            <el-form-item label="商家所属:" prop="status" label-width="75px">
              <el-select clearable v-model="userSearchForm.merchantType" placeholder="全部">
                <el-option v-for="item in merchantTypeOptions" :key="item.value" :label="item.label"
                  :value="item.value">
                </el-option>
              </el-select>
            </el-form-item>
            <el-form-item label="资源收费:" prop="status" label-width="75px">
              <el-select clearable v-model="userSearchForm.isCharge" placeholder="全部">
                <el-option v-for="item in isChargeOptions" :key="item.value" :label="item.label" :value="item.value">
                </el-option>
              </el-select>
            </el-form-item>
          </div>

          <!-- <div class="mainSearchBtnBox">  -->
          <div class="mainSearchBtnBox-right">
            <div>
              <el-form-item label="项目信息:" prop="status" label-width="75px">
                <el-select clearable v-model="userSearchForm.projectId" placeholder="请选择" filterable>
                  <el-option v-for="item in projectList" :key="item.id" :label="item.projectName" :value="item.id">
                  </el-option>
                </el-select>
              </el-form-item>
              <el-form-item label="新客户短信提醒:" label-width="75px" style="margin-left: 65px;">
                <el-select v-model="smsStatus" clearable>
                  <el-option v-for="item in customerCode" :key="item.key" :label="item.label" :value="item.key">
                  </el-option>

                </el-select>

              </el-form-item>
              <el-form-item label="证件审核状态:" prop="auditStatus" label-width="75px" style="margin-left: 82px;">
                <el-select v-model="auditStatus" clearable>
                  <el-option v-for="item in auditStatusConfig" :key="item.key" :label="item.label" :value="item.key">

                  </el-option>
                </el-select>
              </el-form-item>
            </div>

            <el-form-item label="">
              <el-button icon="el-icon-search" type="primary" @click="searchTable()" style="margin-left: 10px;">搜索
              </el-button>
            </el-form-item>
          </div>

          <!-- <el-button type="info" class="searchBtn">取消</el-button> -->
          <!-- </div>  -->
        </el-form>
      </div>
      <el-row>
        <el-table ref="multipleTable" tooltip-effect="dark" border @selection-change="handleSelectionChange"
          style="width: 100%" :data="dataTable">
          <el-table-column align="center" type="selection" width="55"></el-table-column>
          <!-- <el-table-column prop="date" label="全选" width="180"></el-table-column> -->
          <el-table-column align="center" prop="username" label="登录用户名" width="150"></el-table-column>
          <el-table-column align="center" prop="phone" label="手机号" width="100"></el-table-column>
          <el-table-column align="center" prop="name" label="商家名称"></el-table-column>
          <el-table-column align="center" prop="projectName" label="项目信息" width="180">
            <template slot-scope="scope">
              <div v-if="scope.row.projectName">
                <el-popover placement="top-start" trigger="hover" width="200">
                  {{scope.row.projectName}}
                  <div slot="reference" class="name-wrapper">
                    {{scope.row.projectName}}
                  </div>
                </el-popover>
              </div>
              <div v-else>__</div>
            </template>
          </el-table-column>
          <el-table-column align="center" prop="balance" label="账号余额" width="100"></el-table-column>
          <el-table-column align="center" prop="balance" label="剩余餐盟币" width="100"></el-table-column>
          <el-table-column align="center" prop="balance" label="余额状态" width="100">
            <template slot-scope="scope">
              <span v-if="scope.row.balanceStatus==1">正常</span>
              <span v-else-if="scope.row.balanceStatus==0">余额不足</span>
              <span v-else>-</span>
            </template>
          </el-table-column>
          <el-table-column align="center" prop="createTime" label="创建时间" :formatter="dateFormat" width="160">
          </el-table-column>
          <el-table-column align="center" prop="num" label="商家子账号" width="100">
            <template slot-scope="scope">
              <div v-if="scope.row.num > 0">
                <a style="color: rgb(0, 114, 255);text-decoration:underline ;"
                  :href="'/merchant/userManager/subaccountUserPage?parentId='+scope.row.id+'&name='+scope.row.name+'&orgId='+scope.row.orgId+''">子账号（{{scope.row.num}}）</a>
              </div>
              <div v-if="scope.row.num == 0">
                <a style="color: rgb(0, 114, 255);text-decoration:underline ;"
                  @click="addAccountUser(scope.row)">添加子账号</a>
              </div>
            </template>
          </el-table-column>
          <el-table-column align="center" prop="status" label="状态" :formatter="transformStatus" width="80">
          </el-table-column>
          <el-table-column align="center" prop="merchantType" label="商家所属" :formatter="transformMerchantType"
            width="80"></el-table-column>
          <el-table-column align="center" prop="isCharge" label="资源收费" :formatter="transformIsCharge" width="80">
          </el-table-column>

          <el-table-column align="center" prop="merchantCertDto" label="证件" width="180">
            <template slot-scope="scope">
              <div v-if="scope.row.merchantCertDto">
                <div v-if="scope.row.merchantCertDto.busLicenseName">
                  <div class="merchantCertDto" v-if="scope.row.merchantCertDto.busLicenseUrl">
                    <div class="merchantCertDto">
                      <span class="merchantCertDto-name">营业执照:</span>
                      <div
                        v-if="scope.row.merchantCertDto.busLicenseUrl &&scope.row.merchantCertDto.busLicenseUrl.indexOf('.pdf') > -1">
                        <span class="merchantCertDto-look"
                          @click='openPDFFile(scope.row.merchantCertDto.busLicenseUrl)'>
                          查看
                        </span>
                      </div>
                      <div v-else>
                        <el-popover placement="top">
                          <img :src="scope.row.merchantCertDto.busLicenseUrl" class="merchantCertDto-img-ulr" />
                          <span slot="reference" class="merchantCertDto-look">查看</span>
                        </el-popover>
                      </div>
                    </div>
                  </div>
                  <div class="merchantCertDto" v-if="scope.row.merchantCertDto.foodPermitUrl">
                    <div class="merchantCertDto">
                      <span class="merchantCertDto-name">食品流通许可证:</span>
                      <div
                        v-if="scope.row.merchantCertDto.foodPermitUrl&& scope.row.merchantCertDto.foodPermitUrl.indexOf('.pdf') > -1">
                        <span class="merchantCertDto-look"
                          @click='openPDFFile(scope.row.merchantCertDto.foodPermitUrl)'>
                          查看
                        </span>
                      </div>
                      <div v-else>
                        <el-popover placement="top">
                          <img :src="scope.row.merchantCertDto.foodPermitUrl" class="merchantCertDto-img-ulr" />
                          <span slot="reference" class="merchantCertDto-look">查看</span>
                        </el-popover>
                      </div>
                    </div>
                  </div>
                  <div class="merchantCertDto" v-if="scope.row.merchantCertDto.franchiseRecordUrl ">
                    <div class="merchantCertDto">
                      <span class="merchantCertDto-name">特许经营备案:</span>
                      <div
                        v-if="scope.row.merchantCertDto.franchiseRecordUrl &&scope.row.merchantCertDto.franchiseRecordUrl.indexOf('.pdf') > -1">
                        <span class="merchantCertDto-look"
                          @click='openPDFFile(scope.row.merchantCertDto.franchiseRecordUrl)'>
                          查看
                        </span>
                      </div>
                      <div v-else>
                        <el-popover placement="top">
                          <img :src="scope.row.merchantCertDto.franchiseRecordUrl" class="merchantCertDto-img-ulr" />
                          <span slot="reference" class="merchantCertDto-look">查看</span>
                        </el-popover>
                      </div>
                    </div>
                  </div>
                  <div class="merchantCertDto" v-if="scope.row.merchantCertDto.trademarkLicenseUrl ">
                    <div class="merchantCertDto">
                      <span class="merchantCertDto-name">商标注册证:</span>
                      <div
                        v-if="scope.row.merchantCertDto.trademarkLicenseUrl && scope.row.merchantCertDto.trademarkLicenseUrl.indexOf('.pdf') > -1">
                        <span class="merchantCertDto-look"
                          @click='openPDFFile(scope.row.merchantCertDto.trademarkLicenseUrl)'>
                          查看
                        </span>
                      </div>
                      <div v-else>
                        <el-popover placement="top">
                          <img :src="scope.row.merchantCertDto.trademarkLicenseUrl" class="merchantCertDto-img-ulr" />
                          <span slot="reference" class="merchantCertDto-look">查看</span>
                        </el-popover>
                      </div>

                    </div>

                  </div>
                  <div class="merchantCertDto">

                    <div class="merchantCertDto"
                      v-if="(scope.row.merchantCertDto.trademarkAuthUrl && scope.row.merchantCertDto.trademarkAuthStatus === 1)">
                      <span class="merchantCertDto-name">商标授权文件:</span>
                      <div v-if="scope.row.merchantCertDto.trademarkAuthUrl.indexOf('.pdf') > -1">
                        <span class="merchantCertDto-look"
                          @click='openPDFFile(scope.row.merchantCertDto.trademarkAuthUrl)'>
                          查看
                        </span>
                      </div>
                      <div v-else>
                        <el-popover placement="top">
                          <img :src="scope.row.merchantCertDto.trademarkAuthUrl" class="merchantCertDto-img-ulr" />
                          <span slot="reference" class="merchantCertDto-look">查看</span>
                        </el-popover>
                      </div>

                    </div>
                  </div>
                  <div class="merchantCertDto-download" @click="changeHandler(scope.row)">一键下载</div>

                </div>
                <div v-else>线下提供</div>
              </div>
              <div v-else>
                <span style="color: #606266;">暂未上传</span>
                <span @click="uploadUrl(scope.row)" class="merchantCertDto-download">立即上传</span>
              </div>

            </template>

          </el-table-column>
          <el-table-column align="center" prop="merchantCertDto" label="是否商标授权" width="120">
            <template slot-scope="scope">
              <div v-if="(scope.row.merchantCertDto&&scope.row.merchantCertDto.trademarkAuthStatus)">
                <div v-if="scope.row.merchantCertDto.trademarkAuthStatus === 1">是</div>
                <div v-else>否</div>
              </div>
            </template>
          </el-table-column>
          <el-table-column align="center" prop="merchantCertDto" label="证件审核状态" width="120">
            <template slot-scope="scope">
              <div v-if="(scope.row.merchantCertDto&&scope.row.merchantCertDto.auditStatus)">
                {{auditStatusStatus[scope.row.merchantCertDto.auditStatus]}}
                <div v-if="+scope.row.merchantCertDto.auditStatus === 2">
                  <el-popover placement="top" width="160" trigger="hover">
                    <div v-if="scope.row.merchantCertDto.auditReason">{{scope.row.merchantCertDto.auditReason}}</div>
                    <div slot="reference" class="look-reason">查看原因</div>
                  </el-popover>

                </div>
              </div>
            </template>
          </el-table-column>
          <el-table-column align="center" prop="merchantCertDto" label="证件审核" width="150">
            <template slot-scope="scope">
              <div class="auditStatus-class">
                <div v-if="(scope.row.merchantCertDto&&scope.row.merchantCertDto.auditStatus)">
                  <span v-if="+scope.row.merchantCertDto.auditStatus === 3">
                    <el-button type="warning" @click="updateAuditStatus(scope.row, true)">拒绝</el-button>
                  </span>
                  <span v-if="+scope.row.merchantCertDto.auditStatus === 2">
                    <el-button type="success" @click="updateAuditStatus(scope.row)">通过</el-button>
                  </span>
                  <span v-if="+scope.row.merchantCertDto.auditStatus === 1">
                    <el-button type="warning" @click="updateAuditStatus(scope.row, true)">拒绝</el-button>
                    <el-button type="success" @click="updateAuditStatus(scope.row)">通过</el-button>
                  </span>
                </div>
              </div>
            </template>

          </el-table-column>


          <el-table-column align="center" prop="smsStatus" label="新客户短信提醒" :formatter="transformIsCharge" width="150">
            <template slot-scope="scope">
              <div v-if="scope.row.smsStatus || +scope.row.smsStatus ===0">
                {{smsStatusConfig[scope.row.smsStatus]}}
              </div>
              <div v-else>
                __
              </div>
            </template>
          </el-table-column>

          <el-table-column align="center" label="操作" width="150">
            <template slot-scope="scope">
              <shiro:hasPermission name="sys:userManager:edit">
                <div v-if="scope.row.status === 1">
                  <el-button @click="updateStatus(scope.row.id,2,'禁用')" type="danger" size="small">
                    禁用
                  </el-button>
                  <el-button @click="updateStatus(scope.row.id,3,'锁定')" type="warning" size="small">
                    锁定
                  </el-button>
                </div>

                <div v-else-if="scope.row.status === 2">
                  <el-button @click="updateStatus(scope.row.id,1,'启用')" type="success" size="small">
                    启用
                  </el-button>
                </div>
                <div v-else-if="scope.row.status === 3">
                  <el-button @click="updateStatus(scope.row.id,1,'解锁')" type="primary" size="small">
                    解锁
                  </el-button>
                </div>
              </shiro:hasPermission>
            </template>

          </el-table-column>
          <el-table-column align="center" prop="userConnectLimit" label="每日资源上限（条）" width="150"></el-table-column>
        </el-table>
        <table-pagination v-if="paginationShow" :pager="pager" @change="searchTable"></table-pagination>
      </el-row>
    </div>
    <!--证件上传-->

    <el-dialog title="上传证件" :show-close="false" :visible.sync="certificatesVis">
      <div class="certificates">
        <p class="tips" style="margin-bottom: 10px;"><span>证件信息：</span>提交后，需手动点击「证件审核」「通过」</p>
        <el-form class="certif-form" :model="certifForm" :rules="certifRules" label-width="90px" ref="certifForm">
          <el-form-item label="营业执照" prop="busLicenseUrl">
            <el-upload class="upload-demo" :action="uploadOssHost" ref="certifUpLoad" :on-preview="certifPre"
              :on-remove="busLicenseRemove" :on-success="certifSuc" :on-error="handleError"
              :before-upload="CertifBefore" accept=".jpg,.jpeg,.png,.pdf" multiple :data="uploadParamData"
              :on-change="certifChange" :file-list="fileList">
              <el-button v-if="certifForm.busLicenseUrl" @click="certifSubmitUpload('busLicense')" size="small"
                type="success">重新上传</el-button>
              <el-button v-else @click="certifSubmitUpload('busLicense')" size="small" type="primary">点击上传</el-button>
            </el-upload>
          </el-form-item>
          <el-form-item label="食品流通许可证">
            <el-upload class="upload-demo" :action="uploadOssHost" ref="certifUpLoad" :on-preview="certifPre"
              :on-remove="foodPermitRemove" :on-success="certifSuc" :on-error="handleError"
              :before-upload="CertifBefore" accept=".jpg,.jpeg,.png,.pdf" multiple :data="uploadParamData"
              :on-change="certifChange" :file-list="fileList">
              <el-button v-if="certifForm.foodPermitUrl" @click="certifSubmitUpload('foodPermit')" size="small"
                type="success">重新上传</el-button>
              <el-button v-else @click="certifSubmitUpload('foodPermit')" size="small" type="primary">点击上传</el-button>
            </el-upload>
          </el-form-item>
          <el-form-item label="特许经营备案">
            <el-upload class="upload-demo" :action="uploadOssHost" ref="certifUpLoad" :on-preview="certifPre"
              :on-remove="franchiseRecordRemove" :on-success="certifSuc" :on-error="handleError"
              :before-upload="CertifBefore" accept=".jpg,.jpeg,.png,.pdf" multiple :data="uploadParamData"
              :on-change="certifChange" :file-list="fileList">
              <el-button v-if="certifForm.franchiseRecordUrl" @click="certifSubmitUpload('franchiseRecord')"
                size="small" type="success">重新上传</el-button>
              <el-button v-else @click="certifSubmitUpload('franchiseRecord')" size="small" type="primary">点击上传
              </el-button>
            </el-upload>
          </el-form-item>
          <el-form-item label="商标注册证" prop="trademarkLicenseUrl">
            <el-upload class="upload-demo" :action="uploadOssHost" ref="certifUpLoad" :on-preview="certifPre"
              :on-remove="trademarkLicenseRemove" :on-success="certifSuc" :on-error="handleError"
              :before-upload="CertifBefore" accept=".jpg,.jpeg,.png,.pdf" multiple :data="uploadParamData"
              :on-change="certifChange" :file-list="fileList">
              <el-button v-if="certifForm.trademarkLicenseUrl" @click="certifSubmitUpload('trademarkLicense')"
                size="small" type="success">重新上传</el-button>
              <el-button v-else @click="certifSubmitUpload('trademarkLicense')" size="small" type="primary">点击上传
              </el-button>
            </el-upload>
          </el-form-item>
          <el-form-item label="商标授权文件">
            <el-upload class="upload-demo" :action="uploadOssHost" ref="certifUpLoad" :on-preview="certifPre"
              :on-remove="trademarkAuthRemove" :on-success="certifSuc" :on-error="handleError"
              :before-upload="CertifBefore" accept=".jpg,.jpeg,.png,.pdf" multiple :data="uploadParamData"
              :on-change="certifChange" :file-list="fileList">
              <el-button v-if="certifForm.trademarkAuthUrl" @click="certifSubmitUpload('trademarkAuth')" size="small"
                type="success">重新上传</el-button>
              <el-button v-else @click="certifSubmitUpload('trademarkAuth')" size="small" type="primary">点击上传
              </el-button>
            </el-upload>
          </el-form-item>

          <p class="tips" style="margin-top: 20px; margin-bottom: 10px;">只能上传 jpg/jpeg/png/pdf 文件，且不超过5MB</p>

        </el-form>
        <div slot="footer" style="text-align: center; margin-top: 60px;" class="dialog-footer">
          <el-button type="primary" @click="getCertificates('certifForm')">提交</el-button>

          <el-button @click="closeCertif">取 消</el-button>
        </div>
      </div>
    </el-dialog>
    <!-- dialog -->
    <el-dialog :title="addOrModifyDialogTitle" :visible.sync="dialogFormVisible" @close="closeAddCustomFieldDialog"
      width="540px">
      <el-form :model="clueTemplateForm" ref="clueTemplateForm" :rules="rules">

        <el-form-item label="商家名称：" :label-width="formLabelWidth" prop="name">
          <!-- <el-input v-model="clueTemplateForm.name" onkeyup="value=value.replace(/[^\a-\z\A-\Z0-9\u4E00-\u9FA5]/g,'')" autocomplete="off"  maxlength="50" style="width: 290px;"></el-input> -->
          <el-input v-model="clueTemplateForm.name" autocomplete="off" maxlength="50" style="width: 290px;"
            @keyup.native="textVal"></el-input>
        </el-form-item>
        <el-form-item label="手机号：" :label-width="formLabelWidth" prop="phone">
          <el-input v-model="clueTemplateForm.phone" autocomplete="off" maxlength="11" style="width: 290px;"></el-input>
        </el-form-item>
        <el-form-item label="登录密码：" :label-width="formLabelWidth" prop="password">
          <el-input v-model="clueTemplateForm.password" autocomplete="off" maxlength="30" style="width: 290px;"
            onKeyUp="value=value.replace(/[\W]/g,'')"></el-input>
        </el-form-item>
        <el-form-item label="登录用户名：" :label-width="formLabelWidth" prop="username">
          <!-- <el-input v-model="clueTemplateForm.username" :disabled="loginDisabled" onkeyup="value=value.replace(/[^\a-\z\A-\Z0-9\u4E00-\u9FA5]/g,'')" autocomplete="off"  maxlength="30" style="width: 290px;"></el-input> -->
          <el-input v-model="clueTemplateForm.username" :disabled="loginDisabled" autocomplete="off" maxlength="30"
            style="width: 290px;" @keyup.native="textVal"></el-input>
        </el-form-item>
        <el-form-item label="商家所属：" :label-width="formLabelWidth" prop="merchantType">
          <el-select v-model="clueTemplateForm.merchantType" placeholder="全部" @change="merchantTypeClick">
            <el-option v-for="item in merchantTypeOptions1" :key="item.value" :label="item.label" :value="item.value">
            </el-option>
          </el-select>
        </el-form-item>
        <div v-if='!showIsCharge' class="headPortrait">
          <el-form-item label="商家头像：" :label-width="formLabelWidth" prop="businessPortraitUrl">
            <el-input v-model="clueTemplateForm.businessPortraitUrl" autocomplete="off"
              style="width: 290px;display: none;"></el-input>
            <el-upload class="upload-demo" :action="uploadOssHost" ref="refundApplyImgUploadBusiness"
              :on-preview="handlePreview" :on-remove="handleRemove" :on-success="handleSuccess" :on-error="handleError"
              :before-upload="handleBefore" accept=".jpg,.png" multiple :data="uploadParamData" :limit='1'
              :on-change="selectFile" :on-exceed="handleExceed" :auto-upload="false" :file-list="fileList">
              <el-button slot="trigger" size="small" type="primary">选择图片</el-button>
              <el-button style="margin-left: 10px;" size="small" type="success" @click="submitUpload(1)">上传</el-button>
              <div slot="tip" style="margin-top: -10px;height: 27px;">只能上传jpg/png文件，且不超过2MB</div>
              <el-button size="small" v-if='clueTemplateForm.businessPortraitUrl' type="success"
                @click="previewPortrait(1)" plain>头像预览</el-button>
              <el-button size="small" v-if='clueTemplateForm.businessPortraitUrl' type="danger"
                @click="removePortrait(1)" icon="el-icon-delete" circle></el-button>
            </el-upload>
          </el-form-item>
          <el-form-item label="专属KA姓名：" :label-width="formLabelWidth" prop="KAName">
            <el-input v-model="clueTemplateForm.KAName" autocomplete="off" maxlength="50" style="width: 290px;">
            </el-input>
          </el-form-item>
          <el-form-item label="KA头像：" :label-width="formLabelWidth" prop="KAPortraitUrl">
            <el-input v-model="clueTemplateForm.KAPortraitUrl" autocomplete="off" style="width: 290px;display: none;">
            </el-input>
            <el-upload class="upload-demo" :action="uploadOssHost" ref="refundApplyImgUploadKA"
              :on-preview="handlePreview" :on-remove="handleRemove" :on-success="handleSuccess" :on-error="handleError"
              :before-upload="handleBefore" accept=".jpg,.png" multiple :data="uploadParamData" :limit='1'
              :on-change="selectFile" :on-exceed="handleExceed" :auto-upload="false" :file-list="fileList">
              <el-button slot="trigger" size="small" type="primary">选择图片</el-button>
              <el-button style="margin-left: 10px;" size="small" type="success" @click="submitUpload(2)">上传</el-button>
              <div slot="tip" style="margin-top: -10px;height: 27px;">只能上传jpg/png文件，且不超过2MB</div>
              <el-button size="small" v-if='clueTemplateForm.KAPortraitUrl' type="success" @click="previewPortrait(2)"
                plain>头像预览</el-button>
              <el-button size="small" v-if='clueTemplateForm.KAPortraitUrl' type="danger" @click="removePortrait(2)"
                icon="el-icon-delete" circle></el-button>
            </el-upload>
          </el-form-item>
          <el-form-item label="联系电话：" :label-width="formLabelWidth" prop="contactNumber">
            <el-input v-model="clueTemplateForm.contactNumber" autocomplete="off" maxlength="11" style="width: 290px;">
            </el-input>
          </el-form-item>
          <el-form-item label="邮箱：" :label-width="formLabelWidth" prop="email">
            <el-input v-model="clueTemplateForm.email" style="width: 290px;"></el-input>
          </el-form-item>


          <el-form-item class="selectTime" label="不计费时间：" :label-width="formLabelWidth">
            <el-date-picker v-model="clueTemplateForm.noChargeTimeStart" type="date" placeholder="选择日期"
              value-format=" yyyy-MM-dd" format="yyyy-MM-dd">
            </el-date-picker>
            <span>-</span>
            <el-date-picker v-model="clueTemplateForm.noChargeTimeEnd" type="date" placeholder="选择日期"
              value-format=" yyyy-MM-dd" format="yyyy-MM-dd">
            </el-date-picker>
          </el-form-item>
          <el-form-item label="不计费条数" :label-width="formLabelWidth">
            <el-input oninput="value=value.replace(/[^0-9]/g,'')" type="text" v-model="clueTemplateForm.noChargeNumber"
              autocomplete="off" style="width: 290px;">
              <span slot="suffix">条</span>
            </el-input>
          </el-form-item>
        </div>
        <el-form-item label="资源是否收费：" :label-width="formLabelWidth" prop="isCharge" v-show="showIsCharge">
          <el-select v-model="clueTemplateForm.isCharge" placeholder="">
            <el-option v-for="item in isChargeOptions" :key="item.value" :label="item.label" :value="item.value">
            </el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="所属组织架构：" :label-width="formLabelWidth" prop="orgName">
          <el-popover placement="bottom" trigger="click" v-model="isShow">
            <div style="max-height: 300px;overflow-y: auto;">
              <el-tree :data="dataTree" node-key="id" :default-expanded-keys="expandedKeys"
                :default-checked-keys="multipleTreeSelection" ref="tree" highlight-current @node-click="treeNodeClick">
              </el-tree>
            </div>
            <el-button slot="reference" class="orgSelectOopover" style="width: 290px;">
              <el-input v-model="clueTemplateForm.orgName" placeholder="选择所属组织" class="orgSelectInput" readonly>
              </el-input>
              <i class="el-icon-arrow-down" style="float: right;margin-right: -12px;color: #c0c4cc;"></i>
            </el-button>
          </el-popover>
          <!--<el-input v-model="clueTemplateForm.orgName" autocomplete="off" prop="orgName" style="width:185px;margin-right: 6px;"></el-input>
                        <el-button type="primary" @click="dialogFormChooseOrg = true">选择组织</el-button>-->
        </el-form-item>
        <el-form-item label="商家角色：" :label-width="formLabelWidth" prop="roleId">
          <el-select clearable v-model="clueTemplateForm.roleId" placeholder="角色选择" @visible-change="seleckClick"
            style="width: 290px;">
            <el-option v-for="item in roleOptions" :key="item.id" :label="item.roleName" :value="item.id">
            </el-option>
          </el-select>
          <!--<el-input v-model="clueTemplateForm.orgName" autocomplete="off" prop="orgName" style="width:185px;margin-right: 6px;"></el-input>
                        <el-button type="primary" @click="dialogFormChooseOrg = true">选择组织</el-button>-->
        </el-form-item>

        <el-form-item label="新客户短信提醒:" prop="newCode" :label-width="formLabelWidth"
          v-if="clueTemplateForm.merchantType === 2">
          <el-select v-model="clueTemplateForm.newCode">
            <el-option v-for="item in customerCode" :key="item.key" :label="item.label" :value="item.key">
            </el-option>
          </el-select>
        </el-form-item>

      </el-form>
      <div slot="footer" class="dialog-footer" style="text-align:center;">
        <el-button type="primary" :disabled="submitDisabled" @click="saveUser('clueTemplateForm')">提交</el-button>
        <el-button @click="cancelForm('clueTemplateForm')">取 消</el-button>
      </div>
    </el-dialog>

    <el-dialog :title="subAccountFormTitle" :visible.sync="dialogsubAccountForm" @close="closeusersubAccountForm"
      width="540px">
      <el-form :model="subAccountForm" ref="subAccountForm" :rules="subAccountRules">
        <el-form-item label="所属商家：" :label-width="formLabelWidth" prop="name">
          {{merchatName}}
        </el-form-item>
        <el-form-item label="子账号姓名：" :label-width="formLabelWidth" prop="name">
          <!-- <el-input v-model="subAccountForm.name" onkeyup="value=value.replace(/[^\a-\z\A-\Z0-9\u4E00-\u9FA5]/g,'')" autocomplete="off"  maxlength="50" style="width: 290px;"></el-input> -->
          <el-input v-model="subAccountForm.name" autocomplete="off" maxlength="50" style="width: 290px;"
            @keyup.native="textVal"></el-input>
        </el-form-item>
        <el-form-item label="手机号：" :label-width="formLabelWidth" prop="phone">
          <el-input v-model="subAccountForm.phone" autocomplete="off" maxlength="11" style="width: 290px;"></el-input>
        </el-form-item>
        <el-form-item label="登录密码：" :label-width="formLabelWidth" prop="password">
          <el-input v-model="subAccountForm.password" autocomplete="off" maxlength="30" style="width: 290px;"
            onKeyUp="value=value.replace(/[\W]/g,'')"></el-input>
        </el-form-item>
        <el-form-item label="登录用户名：" :label-width="formLabelWidth" prop="username">
          <!-- <el-input v-model="subAccountForm.username"  onkeyup="value=value.replace(/[^\a-\z\A-\Z0-9\u4E00-\u9FA5]/g,'')" autocomplete="off"  maxlength="30" style="width: 290px;"></el-input> -->
          <el-input v-model="subAccountForm.username" autocomplete="off" maxlength="30" style="width: 290px;"
            @keyup.native="textVal"></el-input>
        </el-form-item>
        <el-form-item label="所属组织架构：" :label-width="formLabelWidth" prop="orgName">
          <el-popover placement="bottom" trigger="click" v-model="subaccountisShow">
            <div style="max-height: 300px;overflow-y: auto;">
              <el-tree :data="accountDataTree" node-key="id" :default-expanded-keys="accountExpandedKeys" ref="tree"
                highlight-current @node-click="acoountTreeNodeClick">
              </el-tree>
            </div>
            <el-button slot="reference" class="orgSelectOopover" style="width: 290px;">
              <el-input v-model="subAccountForm.orgName" placeholder="选择所属组织" class="orgSelectInput" readonly>
              </el-input>
              <i class="el-icon-arrow-down" style="float: right;margin-right: -12px;color: #c0c4cc;"></i>
            </el-button>
          </el-popover>
          <!--<el-input v-model="clueTemplateForm.orgName" autocomplete="off" prop="orgName" style="width:185px;margin-right: 6px;"></el-input>
                        <el-button type="primary" @click="dialogFormChooseOrg = true">选择组织</el-button>-->
        </el-form-item>
        <el-form-item label="商家角色：" :label-width="formLabelWidth" prop="roleId">
          <el-select clearable v-model="subAccountForm.roleId" placeholder="角色选择" @visible-change="seleckClick"
            style="width: 290px;">
            <el-option v-for="item in subaccountOptions" :key="item.id" :label="item.roleName" :value="item.id">
            </el-option>
          </el-select>
          <!--<el-input v-model="clueTemplateForm.orgName" autocomplete="off" prop="orgName" style="width:185px;margin-right: 6px;"></el-input>
                        <el-button type="primary" @click="dialogFormChooseOrg = true">选择组织</el-button>-->
        </el-form-item>

        <el-form-item label="新客户短信提醒:" prop="newChildCode" :label-width="formLabelWidth"
          v-if="+childMerchantType === 2">
          <el-select v-model="subAccountForm.newChildCode">
            <el-option v-for="item in customerCode" :key="item.key" :label="item.label" :value="item.key">
            </el-option>
          </el-select>
        </el-form-item>
      </el-form>
      <div slot="footer" class="dialog-footer" style="text-align:center;">
        <el-button type="primary" :disabled="submitDisabled" @click="saveAccountUser('subAccountForm')">提交</el-button>
        <el-button @click="accountcancelForm('subAccountForm')">取 消</el-button>
      </div>
    </el-dialog>
    <el-dialog :visible.sync="dialogVisiblePortrait">
      <img width="100%" :src="dialogImageUrl" alt="">
    </el-dialog>

    <el-dialog title="审核拒绝" :visible.sync="isRefuseDialog" width="540px" :close-on-click-modal="false">
      <div class="refuse-dialog">
        <div class="refuse-dialog-title">
          <span style="color: red;">*</span>
          <span>拒绝原因</span>
        </div>
        <el-input type="textarea" placeholder="请输入审核拒绝原因，100字之内" v-model="textarea" maxlength="100">
        </el-input>
      </div>
      <span slot="footer" class="dialog-footer">
        <el-button type="primary" @click='submitCancel'>提 交</el-button>
        <el-button @click="closeRefuseDialog">取 消</el-button>
      </span>

    </el-dialog>
  </div>
  <!-- import common js-->
  <div th:include="_footer_include :: #jsLib"></div>
</body>
<script src="https://cdn.bootcdn.net/ajax/libs/FileSaver.js/2.0.5/FileSaver.min.js"></script>
<script src="https://cdn.bootcdn.net/ajax/libs/jszip/3.6.0/jszip.min.js"></script>

<script th:inline="javascript">
  var passwordExpires = [[${ passwordExpires }]];//密码最大使用时间
  var reminderTime = [[${ reminderTime }]];//密码到期提醒时间
  var domains = [];
  var orgData = [[${ orgData }]];
  var expandedKeys = [];//默认展开节点
  var roleList = [[${ roleList }]];//当前字段所属的菜单组
  var subaccountRoleDTOs = [[${ subaccountRoleDTOs }]];
  var ossSignatureUrl = [[${ ossUrl }]]; //上传文件地址
  var projectList = [[${ projectList }]];//项目信息



  if (orgData != null) {
    for (var i = 0; i < orgData.length; i++) {
      var curNode = orgData[i];
      expandedKeys.push(curNode.id);
      var childs = curNode.children;
      if (childs) {
        for (var j = 0; j < childs.length; j++) {
          var curChildNode = childs[j];
          expandedKeys.push(curChildNode.id);
        }
      }

    }
  }

  var userVM = new Vue({
    el: '#userManage',
    data: {
      certifForm: {},
      certificatesVis: false,
      certifType: '',
      showUrl: {},
      certifId: '',
      certifRules: {
        busLicenseUrl: [
          { required: true, message: '营业执照不能为空', trigger: 'change' }
        ],
        trademarkLicenseUrl: [
          { required: true, message: '商标注册证不能为空', trigger: 'change' }
        ],
      },
      userId: '',
      textarea: '',
      isRefuseDialog: false, // 拒绝审核
      childMerchantType: 1,
      uploadOssHost: '',
      uploadOssHostWhich: '',
      dialogVisiblePortrait: false,
      dialogImageUrl: '',
      showIsCharge: true,
      merchatName: "",
      subAccountFormTitle: "添加商家子账号",
      dialogsubAccountForm: false,
      paginationShow: false,
      isShow: false,
      subaccountisShow: false,
      loginDisabled: false,
      expandedKeys: expandedKeys,
      accountExpandedKeys: [],
      dataTree: orgData,
      accountDataTree: [],
      roleOptions: roleList,
      subaccountOptions: subaccountRoleDTOs,
      userSearchForm: {
        status: '',
        userName: '',
        name: '',
        merchantType: '',
        isCharge: '',
        projectId: ''
      },
      subAccountForm: {
        username: "",
        name: "",
        phone: "",
        password: "",
        orgName: "",
        orgId: "",
        id: "",
        roleId: "",
        newChildCode: 0
      },
      clueTemplateForm: {
        username: "",
        name: "",
        phone: "",
        password: "",
        orgName: "",
        contactNumber: '',
        businessPortraitUrl: '',
        KAPortraitUrl: '',
        KAName: '',
        noChargeTimeStart: '',
        noChargeTimeEnd: '',
        noChargeNumber: '',
        orgId: "",
        isCharge: "",
        merchantType: "",
        id: "",
        roleId: "",
        email: '',
        newCode: 1

      },
      addOrModifyDialogTitle: '添加商家账号',
      subAccountRules: {
        name: [
          { required: true, message: '商家名称不能为空', trigger: 'blur' }
        ],
        username: [
          { required: true, message: '登录用户名不能为空', trigger: 'blur' }
        ],
        phone: [
          { required: true, message: '请输入手机号', trigger: 'blur' },
          {
            validator: function (rule, value, callback) {
              if (/^[0-9]*$/.test(value) == false) {
                callback(new Error("请输入数字"));
                return
              }
              if (value.length !== 11) {
                callback(new Error("请输入11位数字"));
                return
              }
              callback();
            }, trigger: 'blur'
          }
        ],
        password: [
          { required: true, message: '密码不能为空', trigger: 'blur' },
          {
            validator: function (rule, value, callback) {
              if (value.length < 6 || value.length > 30) {
                callback(new Error("密码为6-30位字母／数字"));
                return
              }
              callback();
            }, trigger: 'blur'
          }
        ],
        orgName: [
          { required: true, message: '组织不能为空', trigger: 'change' }
        ],
        roleId: [
          { required: true, message: '角色不能为空', trigger: 'change' }
        ],
        newChildCode: [
          { required: true, trigger: 'blur' }
        ]
      },
      rules: {
        name: [
          { required: true, message: '商家名称不能为空', trigger: 'blur' }
        ],
        isCharge: [
          { required: true, message: '资源是否收费不能为空', trigger: 'change' }
        ],
        merchantType: [
          { required: true, message: '商家所属不能为空', trigger: 'change' }
        ],
        businessPortraitUrl: [
          { required: true, message: '商家头像不能为空', trigger: 'change' }
        ],
        KAName: [
          { required: true, message: '专属KA姓名不能为空', trigger: 'blur' }
        ],
        KAPortraitUrl: [
          { required: true, message: 'KA头像不能为空', trigger: 'change' }
        ],
        email: [
          { required: true, message: '请输入邮箱地址', trigger: 'blur' },
          { type: 'email', message: '请输入正确的邮箱地址', trigger: ['blur', 'change'] }
        ],
        contactNumber: [
          { required: true, message: '联系电话不能为空', trigger: 'blur' }
        ],
        username: [
          { required: true, message: '登录用户名不能为空', trigger: 'blur' }
        ],
        phone: [
          { required: true, message: '请输入手机号', trigger: 'blur' },
          {
            validator: function (rule, value, callback) {
              if (/^[0-9]*$/.test(value) == false) {
                callback(new Error("请输入数字"));
                return
              }
              if (value.length !== 11) {
                callback(new Error("请输入11位数字"));
                return
              }
              callback();
            }, trigger: 'blur'
          }
        ],
        password: [
          { required: true, message: '密码不能为空', trigger: 'blur' },
          {
            validator: function (rule, value, callback) {
              if (value.length < 6 || value.length > 30) {
                callback(new Error("密码为6-30位字母／数字"));
                return
              }
              callback();
            }, trigger: 'blur'
          }
        ],
        orgName: [
          { required: true, message: '组织不能为空', trigger: 'change' }
        ],
        roleId: [
          { required: true, message: '角色不能为空', trigger: 'change' }
        ],
        newCode: [
          { required: true, trigger: 'blur' }
        ]


      },
      submitDisabled: false,
      dataTable: [],
      pager: {
        total: 0,
        currentPage: 1,
        pageSize: 20,
      },
      multipleSelection: [],
      multipleTreeSelection: [],
      passwordExpires: passwordExpires,
      reminderTime: reminderTime,
      radio: '',
      dialogFormVisible: false,
      dialogFormAdd: false,
      dialogFormChooseRole: false,
      dialogFormChooseOrg: false,
      form: {
        domains: domains,
        maxDay: passwordExpires
      },

      formLabelWidth: '150px',
      formLabelWidth1: '120px',
      statusOptions: [{
        value: '',
        label: '全部'
      }, {
        value: 1,
        label: '启用'
      }, {
        value: 2,
        label: '禁用'
      }, {
        value: 3,
        label: '锁定'
      }],
      merchantTypeOptions: [{
        value: '',
        label: '全部'
      }, {
        value: 2,
        label: '外部'
      }, {
        value: 1,
        label: '内部'
      }],
      isChargeOptions: [
        {
          value: '',
          label: '全部'
        },
        {
          value: 0,
          label: '否'
        }, {
          value: 1,
          label: '是'
        }
      ],
      merchantTypeOptions1: [{
        value: 2,
        label: '外部'
      }, {
        value: 1,
        label: '内部'
      }],
      isChargeOptions: [{
        value: 0,
        label: '否'
      }, {
        value: 1,
        label: '是'
      }],
      searchTypeOptions: [{
        value: 1,
        label: '登录名'
      }, {
        value: 2,
        label: '姓名'
      }, {
        value: 3,
        label: '手机号'
      }],
      storeForm: {
        roleId: '',
        status: '',
        searchType: 2,
        searchText: '',
        orgId: '',
        orgName: ''
      },
      storeId: '',
      scrollTop: 0,
      uploadParamData: {
        key: '22',
        policy: '',
        OSSAccessKeyId: '',
        success_action_status: '200', //让服务端返回200,不然，默认会返回204
        signature: '',
        'x:params': '',
        'realName': ''
      },
      fileList: [],
      ossUrl: ossSignatureUrl,
      projectList: projectList,
      customerCode: [{
        label: '关闭',
        key: 0
      }, {
        label: '开启',
        key: 1
      }],
      smsStatus: '',
      smsStatusConfig: {
        0: '关闭',
        1: '开启'
      },
      auditStatus: '',
      auditStatusConfig: [{
        label: '待审核',
        key: 1
      }, {
        label: '已拒绝',
        key: 2
      }, {
        label: '已通过',
        key: 3
      }],
      auditStatusStatus: {
        1: '待审核',
        2: '已拒绝',
        3: '已通过'
      }

    },
    methods: {
      certifSuc(file) {
        console.log(file, 'file');
      },
      // 证件审核
      updateAuditStatus(row, isRefuse) {
        const {
          id,
          merchantCertDto
        } = row;
        if (isRefuse) {
          this.isRefuseDialog = true; // 拒绝弹出框
          this.userId = id;
          return
        }
        const params = {
          userId: id,
          auditStatus: 3

        }
        axios.post('/merchant/userManager/updateAuditStatus', params).then(res => {
          userVM.$message('修改成功');
          userVM.searchTable()
        })
      },

      openPDFFile(url) {
        window.open(url)
      },
      submitCancel() {

        const auditReason = this.textarea;
        const params = {
          userId: this.userId,
          auditStatus: 2,
          auditReason
        }
        if (!this.textarea) {
          userVM.$message('请填写审核拒绝原因');
          return

        }
        axios.post('/merchant/userManager/updateAuditStatus', params).then(res => {
          userVM.$message('上传成功！记得手动点击「审核通过」');
          userVM.isRefuseDialog = false;
          userVM.textarea = '';
          userVM.searchTable();

        })
      },
      CertifBefore(file) {

        if (file.size > 5 * 1024 * 1024) {
          this.fileList = [];
          this.$message.error('图片最大为5MB');
          return false;
        }
      },

      closeCertif() {
        const allN = Object.values(this.certifForm);
        if (allN.length > 0) {
          const allUrl = allN.every(list => list == '');
          if (!allUrl) {
            this.$confirm('信息没有提交，请确定将弹窗关闭！', '提示', {
              confirmButtonText: '确定',
              cancelButtonText: '取消',
              type: 'warning'
            }).then(() => {
              this.$refs.certifForm.resetFields();
              this.certificatesVis = false
              this.certifForm = {}
            }).catch(() => {
              this.$message({
                type: 'info',
                message: '已取消关闭'
              });
            });
          } else {
            this.$refs.certifForm.resetFields();
            this.certificatesVis = false
          }
        } else {
          this.$refs.certifForm.resetFields();
          this.certificatesVis = false;

        }
      },
      closeRefuseDialog() {
        this.isRefuseDialog = false;
        userVM.textarea = '';
        userVM.$message('取消成功');
      },
      changeHandler(params) {
        const {
          trademarkAuthUrl, // 商标授权文件
          trademarkLicenseUrl, //商标注册证
          franchiseRecordUrl, // 特许经营备案
          foodPermitUrl, // 食品流通许可证
          busLicenseUrl, // 营业执照
          trademarkAuthStatus
        } = params.merchantCertDto;
        const busLicenseName = params.name;

        const data = {
          '营业执照': `${busLicenseUrl}?response-content-type=application/octet-stream`,
          '食品经营许可证': `${trademarkLicenseUrl}?response-content-type=application/octet-stream`,
          '特许经营备案': `${franchiseRecordUrl}?response-content-type=application/octet-stream`,
          '商标注册证': `${foodPermitUrl}?response-content-type=application/octet-stream`,
        }
        // 商标授权 是 才下载
        if (trademarkAuthUrl && +trademarkAuthStatus === 1) {
          data['商标授权文件'] = `${trademarkAuthUrl}?response-content-type=application/octet-stream`
        }



        const zip = new JSZip()
        const cache = {}
        const promises = []
        for (let key in data) {

          const promise = this.getFile({ url: data[key], name: key }).then(dataRes => { // 下载文件, 并存成ArrayBuffer对象
            const arr_name = data[key].split("?")
            const file_name_length = arr_name[0].split('/') // 获取文件名
            const file_name = file_name_length[file_name_length.length - 1]
            const resData = dataRes.data;
            const name = dataRes.name;
            const format = ['.png', '.pdf', '.jpg', '.jpeg']
            let urlName = '';
            format.forEach(subItem => {
              if (data[key].indexOf(subItem) > -1) {
                urlName = subItem;
              }
            })
            // 文件名 需要自定义
            const fileMergeName = busLicenseName + name + urlName;

            zip.file(fileMergeName, resData, { binary: true }) // 逐个添加文件

            cache[file_name] = resData
          })
          promises.push(promise)

        }


        Promise.all(promises).then(() => {
          zip.generateAsync({ type: "blob" }).then(content => { // 生成二进制流
            saveAs(content, `${busLicenseName}证件信息.zip`) // 利用file-saver保存文件
          })
        })
      },
      getFile(item = {}) {
        const url = item.url;
        const name = item.name;
        return new Promise((resolve, reject) => {
          axios({
            method: 'get',
            url,
            responseType: 'blob'
          }).then(data => {
            const url = window.URL.createObjectURL(new Blob([data.data]))
            resolve({ data: data.data, name },)
          }).catch(error => {
            reject(error.toString())
          })
        })
      },
      previewPortrait(type) {
        this.dialogVisiblePortrait = true
        this.dialogImageUrl = ''
        if (type == 1) {
          this.dialogImageUrl = this.clueTemplateForm.businessPortraitUrl
        } else {
          this.dialogImageUrl = this.clueTemplateForm.KAPortraitUrl
        }
      },
      removePortrait(type) {
        if (type == 1) {
          this.clueTemplateForm.businessPortraitUrl = ''
        } else {
          this.clueTemplateForm.KAPortraitUrl = ''
        }
      },
      getUploadParam() {
        var signUrl = this.ossUrl + "?serviceType=aggregation";
        var param = {};

        axios.get(signUrl, param)
          .then(function (response) {
            // console.info(response);
            var respData = response.data;
            var host = respData.host;
            var params = {};
            var new_multipart_params = {
              dir: respData.dir,
              'policy': respData.policy,
              'OSSAccessKeyId': respData.accessid,
              'success_action_status': '200', //让服务端返回200,不然，默认会返回204
              'signature': respData.signature,
              'x:params': params,//自定义编码，basse64编码后的字符串,
              'realName': ''
            };
            userVM.uploadParamData = new_multipart_params;
            userVM.uploadOssHost = host;
          })
          .catch(function (error) {
            console.log(error);
          });
      },
      uploadUrl(row) {
        this.getUploadParam()
        this.certificatesVis = true;

        this.fileList = [];
        this.certifForm = {}
        this.showUrl = {};
        this.certifId = row.id;
      },
      submitUpload(type) {
        this.uploadOssHostWhich = type
        if (type == 1) {
          this.$refs.refundApplyImgUploadBusiness.submit();
        } else if (type == 2) {
          this.$refs.refundApplyImgUploadKA.submit();
        } else {
          this.$message.warning(`点击上传警告`);
        }
      },
      busLicenseRemove(file) {
        this.$set(this.certifForm, `busLicenseUrl`, '')
        this.$set(this.certifForm, `busLicenseName`, '')
      },
      franchiseRecordRemove(file) {
        this.$set(this.certifForm, `franchiseRecordUrl`, '')
        this.$set(this.certifForm, `franchiseRecordName`, '')
      },
      trademarkAuthRemove(file) {
        this.$set(this.certifForm, `trademarkAuthUrl`, '')
        this.$set(this.certifForm, `trademarkAuthName`, '')
      },
      trademarkLicenseRemove(file) {
        this.$set(this.certifForm, `trademarkLicenseUrl`, '')
        this.$set(this.certifForm, `trademarkLicenseName`, '')
      },
      foodPermitRemove(file) {
        this.$set(this.certifForm, `foodPermitUrl`, '')
        this.$set(this.certifForm, `foodPermitName`, '')
      },
      certifRemove(file) {
        this.showUrl[file.name].url = '';
        let names = this.showUrl[file.name].name;
        this.$set(this.certifForm, `${names}Url`, '')
        this.$set(this.certifForm, `${names}Name`, '')
      },
      certifSuc(response, file, fileList) {
        this.$message.success(`上传成功！`);
        var realName = file.name;
        var randomName = userVM.uploadParamData.key;
        var imgUrl = userVM.uploadOssHost + "/" + randomName;
        this.showUrl[realName] = { url: imgUrl, name: this.certifType };

        this.$set(this.certifForm, `${this.certifType}Url`, imgUrl)
        this.$set(this.certifForm, `${this.certifType}Name`, realName)


        // this.certifForm[`${this.certifType}Url`] = imgUrl;
        // this.certifForm[`${this.certifType}Name`] = realName;


      },
      getCertificates(formName) {//提交
        console.log(this.certifForm);
        this.$refs[formName].validate((valid) => {
          if (valid) {
            this.certificatesVis = false;
            this.certifForm.userId = this.certifId;
            if (this.certifForm.trademarkAuthUrl) {
              this.certifForm.trademarkAuthStatus = 1 //1授权 2否
            } else {
              this.certifForm.trademarkAuthStatus = 2 //1授权 2否
            }
            axios.post('/merchant/userManager/addOrUpdate', this.certifForm).then(res => {
              this.$message.success(`上传成功！记得手动点击「审核通过」`);
              userVM.searchTable();
            })
          } else {
            console.log('error submit!!');
            return false;
          }
        });


      },
      certifPre(file) {
        const nameType = file.name.split('.');
        this.dialogImageUrl = this.showUrl[file.name].url
        if (nameType.length > 0 && nameType[1] == 'pdf') {
          window.open(this.dialogImageUrl)
        } else {
          this.dialogVisiblePortrait = true
        }
      },
      certifChange(file, fileList) {

        if (fileList.length > 1) {
          fileList.splice(0, 1);
        }
        userVM.uploadParamData.key = userVM.uploadParamData.dir + userVM.random_string(10) + userVM.get_suffix(file.name),
          userVM.uploadParamData.realName = file.name;
        console.log(this.$refs.certifForm, 'ce');
        this.$refs.certifForm.validateField('busLicenseUrl')
        this.$refs.certifForm.validateField('trademarkLicenseUrl')

      },
      certifSubmitUpload(type) {
        //type 1->营业执照 2->食品流通许可证

        this.certifType = type;
        this.$refs.certifUpLoad.submit();
      },
      handleRemove(file, fileList) {
        this.fileList = [];
        this.clueTemplateForm.businessPortraitUrl = '';
      },
      handleSuccess(response, file, fileList) {
        this.$message.success(`上传成功！`);
        console.info(fileList);
        console.info(userVM.fileList);
        var realName = file.name;
        var randomName = userVM.uploadParamData.key;
        var imgUrl = userVM.uploadOssHost + "/" + randomName;
        console.log(imgUrl, '上传成功地址');
        if (this.uploadOssHostWhich == 1) {
          this.clueTemplateForm.businessPortraitUrl = imgUrl;
        } else {
          this.clueTemplateForm.KAPortraitUrl = imgUrl;
        }
        this.fileList.push(realName);
        this.fileList = [];
      },
      handleError(err, file, fileList) {
        console.info(err);
      },
      handlePreview(file) {
        console.log(file, 'c');
      },
      handleBefore(file) {
        var isTextComputer = file.type === 'image/png' || file.type === 'image/jpeg';
        if (!isTextComputer) {
          this.fileList = [];
          this.$message.error('文件格式错误');
          return false;
        }
        if (file.size > 2 * 1024 * 1024) {
          this.fileList = [];
          this.$message.error('图片最大为2MB');
          return false;
        }
      },
      random_string(len) {
        len = len || 32;
        var chars = 'ABCDEFGHJKMNPQRSTWXYZabcdefhijkmnprstwxyz2345678';
        var maxPos = chars.length;
        var pwd = '';
        for (i = 0; i < len; i++) {
          pwd += chars.charAt(Math.floor(Math.random() * maxPos));
        }
        return pwd;
      },
      get_suffix(filename) {
        var pos = filename.lastIndexOf('.')
        suffix = ''
        if (pos != -1) {
          suffix = filename.substring(pos);
        }
        return suffix;
      },
      selectFile(file, fileList) {
        userVM.uploadParamData.key = userVM.uploadParamData.dir + userVM.random_string(10) + userVM.get_suffix(file.name),
          userVM.uploadParamData.realName = file.name
      },
      handleExceed(files, fileList) {
        //this.$message.warning(`当前限制选择 3 个文件，本次选择了 ${files.length} 个文件，共选择了 ${files.length + fileList.length} 个文件`);
      },
      passwordVal() {
        //只能输入字母／数字
        this.clueTemplateForm.password = this.clueTemplateForm.password.replace(/[^A-Za-z0-9]/g, '');
        this.subAccountForm.password = this.subAccountForm.password.replace(/[^A-Za-z0-9]/g, '');
      },
      textVal() {
        //只能输入中文英文数字 09/17商户名称修改正则,可以输入括号
        this.clueTemplateForm.name = this.clueTemplateForm.name.replace(/[^\a-\z\A-\Z0-9\u4E00-\u9FA5\（\）\(\)]/g, '');
        this.clueTemplateForm.username = this.clueTemplateForm.username.replace(/[^\a-\z\A-\Z0-9\u4E00-\u9FA5]/g, '');
        this.subAccountForm.name = this.subAccountForm.name.replace(/[^\a-\z\A-\Z0-9\u4E00-\u9FA5]/g, '');
        this.subAccountForm.username = this.subAccountForm.username.replace(/[^\a-\z\A-\Z0-9\u4E00-\u9FA5]/g, '');
      },
      saveAccountUser(formName) {
        this.$refs[formName].validate((valid) => {
          if (valid) {
            var formData = userVM.subAccountForm;
            var param = {};
            param.name = formData.name;
            param.username = formData.username;
            param.password = formData.password;
            param.phone = formData.phone;
            param.orgId = formData.orgId;
            param.userType = 3;
            param.status = 1;
            param.parentId = formData.id;
            param.smsStatus = formData.newChildCode;

            var roleList = new Array();
            roleList.push(formData.roleId);
            param.roleList = roleList;
            var url = "";
            url = "/merchant/userManager/saveUser";
            axios.post(url, param)
              .then(function (response) {
                console.info(response);
                var data = response.data;
                if (data.code != "0") {
                  userVM.$message(data.msg);
                  userVM.btnDisabled = false;
                } else {
                  userVM.$message('新增成功');

                  userVM.btnDisabled = false;
                  userVM.dialogFormVisible = false;
                  document.location.href = '/merchant/userManager/initUserList';
                }
              })
              .catch(function (error) {
                userVM.btnDisabled = false;
                console.log(error);
              });
          }
        })
      },
      addAccountUser(obj) {
        this.merchatName = obj.name;
        this.dialogsubAccountForm = true;
        this.subAccountForm.id = obj.id;
        this.childMerchantType = obj.merchantType;
        var param = {};
        param.orgId = obj.orgId;
        axios.post("/merchant/userManager/getAccountOrg", param)
          .then(function (response) {
            console.info(response);
            var data = response.data;
            if (data != null) {
              var orgData = data.data;
              userVM.accountDataTree = orgData;
              for (var i = 0; i < orgData.length; i++) {
                var curNode = orgData[i];
                userVM.accountExpandedKeys.push(curNode.id);
                var childs = curNode.children;
                if (childs) {
                  for (var j = 0; j < childs.length; j++) {
                    var curChildNode = childs[j];
                    userVM.accountExpandedKeys.push(curChildNode.id);
                  }
                }

              }
            }
          })
      },
      saveUser(formName) {
        this.$refs[formName].validate((valid) => {
          if (valid) {
            var formData = userVM.clueTemplateForm;
            var param = {};
            param.name = formData.name;
            param.username = formData.username;
            param.password = formData.password;
            param.phone = formData.phone;
            param.orgId = formData.orgId;
            param.merchantIcon = formData.businessPortraitUrl
            param.kaIcon = formData.KAPortraitUrl
            param.kaName = formData.KAName
            param.kaPhone = formData.contactNumber
            param.noChargeNum = formData.noChargeNumber
            param.noChargeTimeStart = formData.noChargeTimeStart
            param.noChargeTimeEnd = formData.noChargeTimeEnd
            param.email = formData.email
            param.userType = 2;
            param.status = 1;
            param.id = formData.id;
            param.merchantType = formData.merchantType;
            param.isCharge = formData.isCharge;
            param.smsStatus = formData.newCode;
            var roleList = new Array();
            roleList.push(formData.roleId);
            param.roleList = roleList;
            var url = "";
            if (formData.id != null && formData.id != '') {
              if (formData.password == "******") {
                param.password = "";
              }
              url = "/merchant/userManager/updateUser";
            } else {
              url = "/merchant/userManager/saveUser";
            }
            axios.post(url, param)
              .then(function (response) {
                console.info(response);
                var data = response.data;
                if (data.code != "0") {
                  userVM.$message(data.msg);
                  userVM.btnDisabled = false;
                } else {
                  if (userVM.clueTemplateForm.id != null && userVM.clueTemplateForm.id != '') {
                    userVM.$message('修改成功');
                  } else {
                    userVM.$message('新增成功');
                  }
                  userVM.btnDisabled = false;
                  userVM.dialogFormVisible = false;
                  document.location.href = '/merchant/userManager/initUserList';
                }
              })
              .catch(function (error) {
                userVM.btnDisabled = false;
                console.log(error);
              });
          }
        })
      },
      closeAddCustomFieldDialog() {//关闭添加自定义字段dialog
        if (this.$refs['clueTemplateForm'] !== undefined) {
          this.$refs['clueTemplateForm'].resetFields();
        }
      },
      closeusersubAccountForm() {//关闭添加自定义字段dialog
        if (this.$refs['subAccountForm'] !== undefined) {
          this.$refs['subAccountForm'].resetFields();
        }
      },
      cancelForm(formName) {
        if (this.$refs[formName] !== undefined) {
          this.$refs[formName].resetFields();
        }
        this.dialogFormVisible = false;
      },
      accountcancelForm(formName) {
        if (this.$refs[formName] !== undefined) {
          this.$refs[formName].resetFields();
        }
        this.dialogsubAccountForm = false;
      },
      searchTable() {
        var param = {};

        param.status = this.userSearchForm.status;
        param.username = this.userSearchForm.userName;
        param.name = this.userSearchForm.name;
        param.merchantType = this.userSearchForm.merchantType;
        param.isCharge = this.userSearchForm.isCharge;
        param.projectId = this.userSearchForm.projectId;
        param.pageSize = this.pager.pageSize;
        param.pageNum = this.pager.currentPage;
        param.smsStatus = this.smsStatus;
        param.auditStatus = this.auditStatus;


        param.userType = 2;
        console.info(param);
        axios.post('/merchant/userManager/merchantlist', param)
          .then(function (response) {
            var result = response.data;

            var table = result.data;
            userVM.dataTable = table.data;
            userVM.pager.total = table.total;
            userVM.pager.currentPage = table.currentPage;

            // 取出存储的id
            if (!userVM.paginationShow) {
              if (userVM.storeId) {
                userVM.$nextTick(function () {
                  var storage = [];
                  userVM.dataTable.forEach(function (item, index) {
                    if (item.id === userVM.storeId) {
                      storage.push(userVM.dataTable[index]);
                    }
                  })
                  userVM.toggleSelection(storage);
                  userVM.$el.querySelector('.el-table__body-wrapper').scrollTop = userVM.scrollTop;
                })
              }
            } else {
              removeSessionStore("userManageStoreForm");
              removeSessionStore("userManageOtherVal");
            }
            userVM.paginationShow = true;
            userVM.storeForm = userVM.userSearchForm;

          })
          .catch(function (error) {
            console.log(error);
          });

      },
      toggleSelection(rows) { // table select 默认选中fn
        if (rows) {
          rows.forEach(row => {
            this.$refs.multipleTable.toggleRowSelection(row, true);
          });
        } else {
          this.$refs.multipleTable.clearSelection();
        }
      },
      resetForm(formName) {
        console.info(this.$refs[formName]);
        this.$refs[formName].resetFields();
        this.$refs[formName].resetFields();
      },
      //选择行
      handleSelectionChange(val) {
        this.multipleSelection = val;
      },
      //跳转新增用户页
      toAddUser() {
        this.loginDisabled = false;
        this.addOrModifyDialogTitle = "添加商家账号"
        this.dialogFormVisible = true;
        if (this.$refs['clueTemplateForm'] != undefined) {
          this.clueTemplateForm.phone = "";
          this.clueTemplateForm.name = "";
          this.clueTemplateForm.username = "";
          this.clueTemplateForm.password = "";
          this.clueTemplateForm.roleId = "";
          this.clueTemplateForm.id = "";
          this.clueTemplateForm.orgName = "";
          this.clueTemplateForm.contactNumber = '';
          this.clueTemplateForm.businessPortraitUrl = '';
          this.clueTemplateForm.KAPortraitUrl = '';
          this.clueTemplateForm.KAName = '';
          this.clueTemplateForm.noChargeTimeStart = '';
          this.clueTemplateForm.noChargeTimeEnd = '';
          this.clueTemplateForm.noChargeNumber = '';
          this.$refs['clueTemplateForm'].resetFields();
        }
        //TODO
        this.clueTemplateForm.merchantType = 1;
        this.showIsCharge = true;
        this.clueTemplateForm.isCharge = 0;

      },
      //编辑
      toUpdateUser() {
        this.loginDisabled = true;
        var rows = this.multipleSelection;
        if (rows.length != 1) {
          this.$message({
            message: '请选择一条数据进行修改',
            type: 'warning'
          });
          return;
        }
        this.dialogFormVisible = true;
        this.addOrModifyDialogTitle = "修改商家账号"
        var param = {};
        param.id = rows[0].id;
        var url = "/merchant/userManager/getMechantUserById";
        axios.post(url, param)
          .then(function (response) {
            var result = response.data;
            if (result.code == "0") {
              var user = result.data;
              userVM.clueTemplateForm.username = user.username;
              userVM.clueTemplateForm.phone = user.phone;
              userVM.clueTemplateForm.name = user.name;
              userVM.clueTemplateForm.orgId = user.orgId;
              userVM.clueTemplateForm.roleId = user.roleId;
              userVM.clueTemplateForm.id = user.id;
              userVM.clueTemplateForm.orgName = user.orgName;
              userVM.clueTemplateForm.isCharge = user.isCharge;
              userVM.clueTemplateForm.merchantType = user.merchantType;
              userVM.clueTemplateForm.businessPortraitUrl = user.merchantIcon
              userVM.clueTemplateForm.KAPortraitUrl = user.kaIcon
              userVM.clueTemplateForm.KAName = user.kaName
              userVM.clueTemplateForm.contactNumber = user.kaPhone
              userVM.clueTemplateForm.noChargeNumber = user.noChargeNum
              userVM.clueTemplateForm.noChargeTimeStart = user.noChargeTimeStart
              userVM.clueTemplateForm.noChargeTimeEnd = user.noChargeTimeEnd
              userVM.clueTemplateForm.email = user.email;
              userVM.clueTemplateForm.password = "******";
              if (userVM.clueTemplateForm.merchantType === 1) {
                userVM.showIsCharge = true;
              } else {
                userVM.showIsCharge = false;
              }
              userVM.multipleTreeSelection = [];
              userVM.multipleTreeSelection.push(user.orgId);

            } else {
              userVM.$message.error(msg + "失败");
            }
          })
          .catch(function (error) {
            console.log(error);
          });
      },
      //修改状态
      updateStatus(id, status, msg) {
        var param = {};
        param.id = id;
        param.status = status;
        var url = "/user/userManager/updateStatusDisable";
        if (status != 1) {
          url = "/user/userManager/updateStatusEnable";
        }
        axios.post(url, param)
          .then(function (response) {
            var result = response.data;
            if (result.code == "0") {
              userVM.$message({
                message: '商家账号' + msg + '成功。商家账号状态变为' + msg + '。', type: 'success', duration: 1000, onClose: function () {
                  userVM.searchTable();
                }
              });

            } else {
              userVM.$message.error(msg + "失败");
            }
          })
          .catch(function (error) {
            console.log(error);
          });
      },
      //状态转换方法
      transformStatus(row, column, cellValue, index) {
        var text = "";
        if (cellValue == "1") {
          text = "启用"
        } else if (cellValue == "2") {
          text = "禁用"
        } else if (cellValue == "3") {
          text = "锁定"
        }
        return text;
      },
      //机构名称展示方法
      transformOrg(row, column, cellValue, index) {
        var text = "";
        if (row.parentParentOrgName) {
          text += row.parentParentOrgName + "-";
        }
        if (row.parentOrgName) {
          text += row.parentOrgName + "-";
        }
        if (cellValue) {
          text += cellValue;
        }
        return text;
      },
      //角色转换方法
      transformRole(row, column, cellValue, index) {
        var text = "";
        if (cellValue != undefined && cellValue[0] != undefined) {
          text = cellValue[0].roleName;
        }
        return text;
      },
      transformMerchantType(row, column, cellValue, index) {
        var text = "";
        if (cellValue == "2") {
          text = "外部"
        } else if (cellValue == "1") {
          text = "内部"
        }
        return text;
      },
      transformIsCharge(row, column, cellValue, index) {
        var text = "";
        if (cellValue == "0") {
          text = "否"
        } else if (cellValue == "1") {
          text = "是"
        }
        return text;
      },
      //日期数据格式化方法
      dateFormat(row, column, cellValue, index) {
        if (cellValue == undefined) {
          return "";
        }
        return moment(cellValue).format("YYYY-MM-DD HH:mm:ss");
      },
      handleSizeChange(val) {
        //下拉框  每页 10,20条切换 调用
        console.log(`每页 ${val} 条`);
        this.pageSize = val;
        this.initTableData(1);
      },
      handleCurrentChange(val) {
        //点击 页码
        console.log(`当前页: ${val}`);
        this.initTableData(val);
      },
      // 提交弹窗
      submitForm(formName) {
        this.$refs[formName].validate((valid) => {
          if (valid) {
            console.log(this.form.domains)//
            var domainsList = this.form.domains;
            var array = new Array();
            var newReminderTime = "";
            for (var i = 0; i < domainsList.length; i++) {
              array.push(domainsList[i].value);
              if (i == 0) {
                newReminderTime = newReminderTime + domainsList[i].value;
              } else {
                newReminderTime = newReminderTime + "," + domainsList[i].value;
              }
            }
            if (passwordExpires == this.form.maxDay && reminderTime == newReminderTime) {
              userVM.dialogFormVisible = false;
              return;
            }
            this.$confirm('确定更新保存并执行操作？', '提示', {
              confirmButtonText: '确定',
              cancelButtonText: '取消',
              type: 'warning'
            }).then(() => {
              var param = {};
              param.passwordExpires = this.form.maxDay;
              param.reminderTime = array;
              axios.post('/user/userManager/updatePasswordSetting', param)
                .then(function (response) {
                  var result = response.data;
                  if (result.code == "0") {
                    userVM.$message.success("设置成功");
                    userVM.dialogFormVisible = false;
                    passwordExpires = userVM.form.maxDay;
                    reminderTime = newReminderTime;
                  } else {
                    userVM.$message.error(result.msg);
                  }
                })
                .catch(function (error) {
                  console.log(error);
                });
            }).catch(() => {
              this.$message({
                type: 'info',
                message: '已取消'
              });
            });
          } else {
            console.log('error submit!!');
            return false;
          }
        });
      },
      merchantTypeClick(val) {
        if (val == 2) {
          this.showIsCharge = false;
          this.clueTemplateForm.isCharge = 1;
        } else {
          this.showIsCharge = true;
          this.clueTemplateForm.isCharge = 0;
        }
      },
      showDialogFormVisible() {
        if (this.$refs['form'] !== undefined) {
          this.$refs['form'].resetFields();
        }
        var newDomains = [];
        var reminderTimeList = reminderTime.split(",");
        for (var i = 0; i < reminderTimeList.length; i++) {
          var domain = {};
          domain.value = reminderTimeList[i];
          newDomains.push(domain);
        }
        domains = newDomains;
        this.form.domains = domains;
        this.form.maxDay = passwordExpires;
        this.dialogFormVisible = true;
      },
      removeDomain(item) {
        var index = this.form.domains.indexOf(item)
        if (index !== -1) {
          this.form.domains.splice(index, 1)
        }
      },
      addDomain() {
        this.form.domains.push({
          value: '',
          key: Date.now()
        });
      },
      treeNodeClick(data, node, obj) {
        //if(data.children==null){
        this.clueTemplateForm.orgName = data.label;
        this.clueTemplateForm.orgId = data.id;
        this.isShow = false
        //}
      },
      acoountTreeNodeClick(data, node, obj) {
        //if(data.children==null){
        this.subAccountForm.orgName = data.label;
        this.subAccountForm.orgId = data.id;
        this.subaccountisShow = false
        //}
      },
      seleckClick() {
        // console.log(0)
        this.isShow = false;
      }
    },
    created() {

      this.getUploadParam();
      // 进入页面判断有是否有存储值
      if (!this.paginationShow) {
        var storeVal = getSessionStore("userManageStoreForm");
        var otherVal = getSessionStore("userManageOtherVal");
        if (storeVal && otherVal) {
          this.userSearchForm = storeVal;
          this.$set(this.pager, "currentPage", otherVal.currentPage);
          this.storeId = otherVal.clueId;
          this.scrollTop = otherVal.scrollTop;
        }
      };
      // console.info("create method");
      var localVal = localStorage.getItem('allChangePageSize') ? parseInt(localStorage.getItem('allChangePageSize')) : '';
      if (localVal) { this.pager.pageSize = localVal; }
      this.searchTable();
    },
    mounted() {
      console.info("mounted method");
      document.getElementById('userManage').style.display = 'block';

    }
  })

</script>

</html>